package org.dxw.common.ano;


import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * 用来接收json串里的参数 eg:
 *   json参数：  {"id":12, "userName": "dxw"}
 *   @PostMapping("/test1")
 *   public void test1(@ReqJSON("id") Long id, @ReqJSON(value = "userName", required = false)String userName, HttpServletRequest request){
 *        System.out.println(UtopProperties.url);
 *        System.out.println(UtopProperties.userName);
 *        System.out.println(UtopProperties.passWord);
 *        System.out.println(UtopProperties.timeOut);
 *        return ;
 *    }
 */
@Target({ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ReqJSON {

    @AliasFor("name")
    String value() default "";

    @AliasFor("value")
    String name() default "";

    boolean required() default true;

}
